package com.openbravo.pos.util;

import javax.print.DocFlavor;
import javax.print.DocFlavor.SERVICE_FORMATTED;
import javax.print.PrintService;
import javax.print.PrintServiceLookup;

public class ReportUtils
{
  public static PrintService getPrintService(String paramString)
  {
    if (paramString == null)
      return PrintServiceLookup.lookupDefaultPrintService();
    if ("(Show dialog)".equals(paramString))
      return null;
    if ("(Default)".equals(paramString))
      return PrintServiceLookup.lookupDefaultPrintService();
    PrintService[] arrayOfPrintService1 = PrintServiceLookup.lookupPrintServices(DocFlavor.SERVICE_FORMATTED.PRINTABLE, null);
    for (PrintService localPrintService : arrayOfPrintService1)
      if (paramString.equals(localPrintService.getName()))
        return localPrintService;
    return PrintServiceLookup.lookupDefaultPrintService();
  }

  public static String[] getPrintNames()
  {
    PrintService[] arrayOfPrintService = PrintServiceLookup.lookupPrintServices(DocFlavor.SERVICE_FORMATTED.PRINTABLE, null);
    String[] arrayOfString = new String[arrayOfPrintService.length];
    for (int i = 0; i < arrayOfPrintService.length; i++)
      arrayOfString[i] = arrayOfPrintService[i].getName();
    return arrayOfString;
  }
}

/* Location:           D:\PowerFulPOS-2.30.2\openbravopos.jar
 * Qualified Name:     com.openbravo.pos.util.ReportUtils
 * JD-Core Version:    0.6.0
 */